From: Florian Müllner Date: Wed, 31 Aug 2022 10:51:54 +0000 (+0200) Subject: shell/screenshot: Plug memory leak X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~452^2^2~22 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=66ae4c7ff33bebdc3ba67149e870c68903e5af10;p=gnome-shell.git shell/screenshot: Plug memory leak grab_screenshot_content() does not follow the usual pattern of ``` task = g_task_new (...); g_task_run_in_thread (task, ...); g_object_unref (task); ``` That means we hold the original reference throughout the operation, and must release it ourselves when done. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5501 Part-of: --- diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c index fcf2da236..f7132eee8 100644 --- a/src/shell-screenshot.c +++ b/src/shell-screenshot.c @@ -308,6 +308,7 @@ grab_screenshot_content (ShellScreenshot *screenshot, float scale; g_autoptr (GError) error = NULL; g_autoptr (ClutterContent) content = NULL; + g_autoptr (GTask) task = result; MetaCursorTracker *tracker; CoglTexture *cursor_texture; int cursor_hot_x, cursor_hot_y;